﻿internal class Program
{
    public static void Main(string[] args)
    {
        /*string[] str = new string[3];

        str[0] = "A123";
        str[1] = "B456";
        str[2] = "C789";
        // fraudulentOrderIDs[3] = "D000";
        str[0] = "asdas";
        //使用字符内插打印
        Console.WriteLine($"fraudulent order ID: {str[0]}");

        //这里的for循环跟python的很像
        foreach (string s in str)
        {
            Console.Write(s + " ");
        }

        //初始化一个int数组求和
        int[] arr = { 1, 2, 3 };
        int sum = 0;
        for (int i = 0; i < arr.Length; i++)
        {
            Console.WriteLine($"第{i}次:值{arr[i]}");
        }*/
        /*string[] strs = new String[] { "B123", "C234", "A345", "C15", "B177", "G3003", "C235", "B179" ,"b234"};
        foreach (string s in strs)
        {
            /*
             * StartsWith 方法默认区分大小写，因此不会匹配小写“b”开头的字符串。
             * 若需不区分大小写，可修改为：s.StartsWith("B", StringComparison.OrdinalIgnoreCase)。
             * StringComparison.CurrentCulture 严格区分大小写
             #1#
            if (s.StartsWith("B", StringComparison.OrdinalIgnoreCase))
            {
                Console.WriteLine(s);
            }
        }*/

        /*char[] str = "anisudhoooa".ToArray();
        //反装数组
        Array.Reverse(str);
        int count = 0;
        for (int i = 0; i < str.Length; i++)
        {
            if (str[i] == 'a')
            {
                count++;
            }
        }
        Console.WriteLine(count);*/

        // 学生姓名
        string[] studentNames = new string[] { "Sophia", "Andrew", "Emma", "Logan" };
        //成绩
        int[] sophiaScores = new int[] { 90, 86, 87, 98, 100 };
        int[] andrewScores = new int[] { 92, 89, 81, 96, 90 };
        int[] emmaScores = new int[] { 90, 85, 87, 98, 68 };
        int[] loganScores = new int[] { 90, 95, 87, 88, 96 };

        int sum = 0; //成绩总分
        int age = 0;

        for (int i = 0; i < studentNames.Length; i++)
        {
            if (studentNames[i] == "Sophia")
            {
                for (int j = 0; j < sophiaScores.Length; j++)
                {
                    sum += sophiaScores[i];
                    age = sum / sophiaScores.Length;
                }
                Console.WriteLine($"{studentNames[i]}\t总分:{sum}\t平均{age}");
            }
            else if (studentNames[i] == "Andrew")
            {
                sum += andrewScores[i];
                age = sum / andrewScores.Length;
            }
            else if (studentNames[i] == "Emma")
            {
                sum += emmaScores[i];
                age = sum / emmaScores.Length;
            }
            else
            {
                sum += loganScores[i];
                age = sum / loganScores.Length;
            }
            
        }
    }

}